home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-6.dms / in.adf / Install.run / GOLDEDDATA / arexx / dcc.ged < prev    next >
Encoding:
Text File  |  1996-11-10  |  1.8 KB  |  79 lines

  1. /* $VER: 1.0, ©1996 Dietmar Eilert. Compile current file using DICE-C  */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  9.  
  10. if (RC ~= 0) then
  11.     exit
  12.  
  13. OPTIONS FAILAT 6                            /* ignore warnings         */
  14.  
  15. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  16.  
  17. /* ------------------------- INSERT YOUR CODE HERE: ------------------ */
  18.  
  19. 'QUERY CAT'
  20. isGerman = (result = "deutsch")
  21.  
  22. 'QUERY ANYTEXT'
  23.  
  24. if (result = 'TRUE') then 
  25.  
  26.     do
  27.  
  28.         'QUERY DOC VAR OLDNAME'             /* remember current file name */
  29.         'SAVE ALL NAME="T:TEST.C"'          /* create temorary file */
  30.  
  31.         shell                               /* address shell */
  32.  
  33.         'dcc T:TEST.C -// -LDINCLUDE: -oT:TEST'
  34.  
  35.         ok = (RC = 0)
  36.  
  37.         shell                               /* address host (GoldED) */
  38.  
  39.         'NAME NEW ' || oldname              /* restore old file name */
  40.  
  41.         if (ok) then do
  42.  
  43.             if (isGerman) then
  44.                 'REQUEST BODY="DCC fertig. Programm starten ?" BUTTON="!STARTEN|_Abbruch"'
  45.             else
  46.                 'REQUEST BODY="DCC done. Run program ?" BUTTON="!RUN|_Cancel"'
  47.  
  48.             if (result = 1) then do
  49.  
  50.                 shell
  51.                 'T:TEST'
  52.                 shell
  53.  
  54.             end
  55.         end
  56.     end
  57.  
  58. else do
  59.  
  60.     if (isGerman) then
  61.         'REQUEST PROBLEM="Kein Text vorhanden ?!"'
  62.     else
  63.         'REQUEST PROBLEM="Text buffer is empty ?!"'
  64. end
  65.  
  66. /* ---------------------------- END OF YOUR CODE ----------------------- */
  67.  
  68. 'UNLOCK' /* VERY important: unlock GUI */
  69.  
  70. exit
  71.  
  72. SYNTAX:
  73.  
  74. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  75.  
  76. 'UNLOCK'
  77.  
  78. exit
  79.